package com.lianqi.emcpframework.commons.bean.validate;

/**
 * @program emcp-framework
 * @ClassName ValidateBean
 * @description: 类校验接口
 * @author: sky
 * @create: 2019/04/04 10:19
 */
public interface ValidateBean extends Bean {

    /**
     * 尝试验证此bean,如果验证未通过,将抛出{@link }
     *
     * @param group 验证分组
     * @param <T>   当前对象类型
     * @return 当前对象
     */
    default <T extends ValidateBean> T tryValidate(Class... group) {
        BeanValidator.tryValidate(this, group);
        return (T) this;
    }
}
